package com.tan.kotlintest

class Student() {

    lateinit var name: String
    var age: Int = 0
    var score: Int = 0
    private val nameOne ="aabbcc"

    constructor(name: String) : this() {
        this.name = name
    }

    constructor(name: String, age: Int) : this() {
        this.name = name
        this.age = age
    }

    constructor(name: String, age: Int, score: Int) : this() {
        this.name = name
        this.age = age
        this.score = score
    }
}


fun main() {
    val student1 = Student("军")
    val student2 = Student("军1", 18)
    val student3 = Student("军3", 20, 100)
    println("构造器1: ${student1.name}")
    println("构造器2: ${student2.name} ,年龄: ${student2.age}")
    println("构造器2: ${student3.name} ,年龄: ${student3.age} ,分数: ${student3.score}")
}